export const search_mixin = {
  data() {
    return {
      search: {   //搜索条件
        visible: false,//表单弹窗的显示标识
        criteria: {//查询条件
          filter: '',//通用过滤(默认情况下后台不支持)
          order: '',//排序条件 field desc,field asc
        }
      }
    }
  },
  methods: {
    /**重置搜索*/
    searchReset(visible = false) {
      this.searchMode(visible, {filter: '', order: ''})
    },
    /**搜索模式*/
    searchMode(visible = false, criteria) {
      this.search.visible = visible
      if (criteria) {
        this.search.criteria = criteria
      }
    },
  }
}